package com.bw.a2207a.view.adapter

import android.content.Context
import android.graphics.Color
import com.bw.a2207a.R
import com.bw.a2207a.bean.TypeBean
import com.zhy.adapter.recyclerview.CommonAdapter
import com.zhy.adapter.recyclerview.base.ViewHolder

/**
 *
 * @ClassName: HomeGoodsAdapter
 * @Description: java类作用描述
 * @Author: zhangyanchao
 * @CreateDate: 2024/9/19 8:42 AM
 * @Version: 1.0
 */
class TypeLeftAdapter(context: Context?, layoutId: Int, data: List<TypeBean>) :
    CommonAdapter<TypeBean>(context, layoutId, data) {
    override fun convert(holder: ViewHolder?, t: TypeBean, position: Int) {
        holder?.setText(R.id.tv_name, t?.category_name)

        if (t.isChecked) {
            holder?.setBackgroundColor(R.id.tv_name, Color.WHITE)
        } else {
            holder?.setBackgroundColor(R.id.tv_name, mContext.getColor(R.color.gry))
        }
    }
}